# -*- coding: utf-8 -*-
"""
Created on Tue May 21 15:29:48 2024

@author: 29865
"""

from sklearn.preprocessing import StandardScaler
import numpy as np
from sklearn.impute import SimpleImputer

data = np.array([[ 1., -1.,  2.],
                 [ 2.,  0.,  0.],
                 [ 0.,  1., -1.]])

imp = SimpleImputer(missing_values=np.nan, strategy='mean')  # 创建按列均值填充策略对象
Fdata=imp.fit_transform(data) #返回填充后的数据集Fdata

scaler = StandardScaler()
scaler_data = scaler.fit_transform(Fdata)

mean = scaler_data.mean(axis=0)
std = scaler_data.std(axis=0)